#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>

/*
  (1.5*) Create a vector<char> containing the letters of the alphabet
  in order. Print the elements of that vector in order and in reverse
  order.
 */

class character_generator
{
public:
  character_generator()
    : c('a')
  { }

  char
  operator()()
  {
    return c++;
  }

private:
  char c;
};


int main()
{
  std::vector<char> V(26);
  std::generate(V.begin(), V.end(), character_generator());

  std::copy(V.begin(), V.end(), std::ostream_iterator<char>(std::cout, " "));
  std::cout << std::endl;

  std::copy(V.rbegin(), V.rend(), std::ostream_iterator<char>(std::cout, " "));
  std::cout << std::endl;
}
